#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;

//定义名为ex_class的类模板
template <class T>  class ex_class
{
    T value;
public:
    ex_class(T v) { value=v; }
    void set_value(T v) { value=v; }
    T get_value(void) {return value;}
};

int main(int argc, char** argv) {
        //测试int类型数据
    ex_class <int> a(5),b(10);
    cout<<"a.value:"<<a.get_value()<<endl;
    cout<<"b.value:"<<b.get_value()<<endl;

    //测试char类型数据
    ex_class <char> ch('A');
    cout<<"ch.value:"<<ch.get_value()<<endl;
    ch.set_value('a');
    cout<<"ch.value:"<<ch.get_value()<<endl;

    //测试double类型数据
    ex_class <double> x(5.5);
    cout<<"x.value:"<<x.get_value()<<endl;
    x.set_value(7.5);
    cout<<"x.value:"<<x.get_value()<<endl;
    return 0;
}